//
//  YWCirculationManager.h
//  maintain
//
//  Created by Kyo on 16/6/22.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"

@class YWCirculationInfo;
@class YWTroubleMissionModel;
@class YWEquipmentTroubleRecordJson;
@class YWHandler;

@interface YWCirculationManager : NSObject
YWSingletonH(Manager)

/**
 *  保存更新流转信息
 *
 *  @return 结果
 */
- (BOOL)updateCirculationInfoWithArray:(NSArray*)circulationInfoArray;
/**
 *  保存更新流转信息(本地构建的)
 *
 *  @return 结果
 */
- (BOOL)saveCirculationInfoWithArray:(NSArray*)circulationInfoArray;
/**
 *  报障和完成维修任务时创建本地流转信息并保存，返回成功后更新掉这条
 *
 *  @return 结果
 */
- (void)createAndSaveLocalCirculationInfoWithType:(NSInteger)type troubleId:(NSInteger)troubleId recipient:(YWHandler*)recipient note:(NSString*)note;
/**
 *  更新流转信息已读状态
 *
 *  @return 无
 */
- (BOOL)updateReadStatusWithTroubleId:(NSInteger)troubleId;
/**
 *  更新流转信息未读数
 *
 *  @return 无
 */
- (NSInteger)noReadCountWithTroubleId:(NSInteger)troubleId;
/**
 *  获取流转信息
 *
 *  @param troubleId 报障单troubleId
 *
 *  @return 结果
 */
- (NSArray *)circulationInfoArrayWithTroubleId:(NSInteger)troubleId;

- (YWCirculationInfo *)circulationInfoWithCirculationType:(NSInteger)type troubleId:(NSInteger)troubleId;

/**
 *  请求流转信息
 *
 *  @return 结果
 */
-(void)requestCirculationInfoWithTroubleId:(NSInteger)troubleId needTip:(BOOL)needTip WithComplete:(void (^)(BOOL))complete;
/**
 *  在记录模块请求流转信息
 *
 *  @return 结果
 */
- (void)requestCirculationInfoOfRecordWithTroubleId:(NSInteger)troubleId WithComplete:(void(^)(YWEquipmentTroubleRecordJson *troubleMissionJson))complete;
/**
 *  取消报障单
 *
 *  @return 结果
 */
- (void)cancelPostTroubleWithTroubleId:(NSInteger)troubleId cancelNote:(NSString*)cancelNote WithComplete:(void(^)(NSInteger statusCode))complete;
/**
 *  取消维修任务
 *
 *  @return 结果
 */
- (void)cancelTroubleMissionWithTrouble:(YWTroubleMissionModel*)troubleMissionModel WithComplete:(void(^)(NSInteger statusCode))complete;
/**
 *  退回维修任务
 *
 *  @return 结果
 */
- (void)rejectTroubleMissionWithTrouble:(YWTroubleMissionModel*)troubleMissionModel rejectReason:(NSString*)rejectReason WithComplete:(void(^)(NSInteger statusCode))complete;
@end
